package com.example.controller;

import com.example.common.Result;
import com.example.entity.Expenses;
import com.example.entity.Notice;
import com.example.service.LoanService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description 财务审核
 * @Author dingchunlin
 * @Date 2023/11/8 11:24
 * @Version 1.0.0
 */
@RestController
@RequestMapping("/loan")
public class LoanController {

    @Autowired
    private LoanService loanService;

    /**
     * 分页查询
     */
    @GetMapping("/selectPage")
    public Result selectPage(Expenses expenses,
                             @RequestParam(defaultValue = "1") Integer pageNum,
                             @RequestParam(defaultValue = "10") Integer pageSize) {
        PageInfo<Expenses> page = loanService.selectPage(expenses, pageNum, pageSize);
        return Result.success(page);
    }

    @PutMapping("/updateStatus/{id}")
    public Result updateStatus(@PathVariable("id") Integer id){
        loanService.updateStatus(id);
        return Result.success();
    }


}